package com.sqx.modules.stockManage.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.stockManage.entity.StockManage;
import com.sqx.modules.stockManage.service.StockManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description：TODO
 * @author： qiao
 * @create： 2025/3/6 16:39
 */
@RestController
@RequestMapping(value = "/admin/stockManage")
@Api(value = "库存管理---管理端", tags = {"库存管理---管理端"})
public class AdminStockManage {

    @Autowired
    private StockManageService stockService;

    @ApiOperation("添加或修改库存管理")
    @PostMapping("/addStockManage")
    public Result addStockManage(StockManage stockManage) {
        return stockService.addStockManage(stockManage);
    }

    @ApiOperation("删除库存管理")
    @PostMapping("/deleteStockManage")
    public Result deleteStockManage(Long id) {
        return stockService.deleteStockManage(id);
    }

    @ApiOperation("查询库存管理")
    @GetMapping("/selectStockManageById")
    public Result selectStockManageById(Long id) {
        return stockService.selectStockManageById(id);
    }

    @ApiOperation("查询库存管理列表")
    @GetMapping("/getStockManageList")
    public Result getStockManageList(Integer page, Integer limit, StockManage stockManage) {
        return Result.success().put("data",stockService.getStockManageList(page, limit, stockManage));
    }
}
